local CommonOHOH = _G.CommonOHOH;
local M = CommonOHOH.class.new(script, CommonOHOH.files.CommonObject());
local ConnectClass=_G.CommonOHOH.load.Connect();
local levels_cfg = CommonOHOH.config.Levels
local createMonster_cfg = CommonOHOH.config.CreateMonster


function M.new(...)
	return M(...);
end;


function M.ctor(self,lvId,battle)


    self.PassEvent=ConnectClass.new() --通关事件
    self.cfg=levels_cfg[lvId] --关卡配置
    self.Battle=battle --一场战斗对象

    -- self.MonsterWaveList=self.cfg.monster --刷怪波次信息：格式{{1,2,3}，{7,8,9}}
    -- self.MonsterWaveDt= self.cfg.dt --刷怪间隔
    
    local monstList,dtList=createMonster_cfg.Get_List_Monster_Dt(lvId)
    self.MonsterWaveList=monstList --刷怪波次信息：格式{{1,2,3}，{7,8,9}}
    self.MonsterWaveDt=dtList --刷怪间隔
   
    self.Id=lvId --关卡ID


    M.super.ctor(self);
    self:AddPrivateComponent(script.create)


end;


function M.GetBattle(self)
    return  self. Battle
end

function M.GetId(self)   
    return self.Id
end

-- 返回关卡怪物数量
function M.MonsterCount(self)
    return self:GetPrivateComponent("create"):GetMonsterCount()
end

--激活
function M.Action(self)
    self:GetPrivateComponent("create"):Action()
end

-- 通关
function M.Pass(self)
    self.PassEvent:Action(self.Id)
end

--关卡销毁
function M.dtor(self)
    -- print("---BB---关卡被销毁了-----",self:GetId())

    self.PassEvent:dtor()
	M.super.dtor(self);
end;




return M
